import { post, get, del, patch } from '@/request/request'
import type { AddReq, DelReq, EditReq } from '@fast-crud/fast-crud'
const API = '/api/article'

export const addRequest = ({ form }: AddReq) => post(API, form)
export const delRequest = ({ row }: DelReq) => del(`${API}/${row.id}`)
export const editRequest = ({ form }: EditReq) => {
  return patch(`${API}/${form.id}`, form)
}
export const pageRequest = (data: any) => get(API, data)
export const batchDelete = (form: DelReq) => post(`${API}/batchDelete`, form)
export const getDetail = (id: string) => get(`${API}/${id}`)
